<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('创建任务列表')" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <div class="select-list">
                    <ul>
                        <li>
                            任务名称：<input type="text" name="roleName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>

    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:role:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:role:remove')}]];
    var prefix = ctx + "cms/taskdelaycheck";

    $(function() {
        var options = {
            url: prefix + "/list",
            updateUrl: prefix + "/edit/{id}",
            sortName: "aname",
            modalName: "延期申请",
            columns: [{
                checkbox: true
            },
                {
                    field: 'aname',
                    title: '申请人'
                },

                {
                    field: 'endDate',
                    title: '延期到（日期）',
                    sortable: true
                },

                {
                    field: 'cause',
                    title: '申请原因',
                    sortable: true
                },
                {
                    field: 'astatus',
                    title: '批复状态',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if(row.astatus=="2"){
                            return "未批复"
                        }

                        return row.astatus=="0"?"同意":"拒绝";
                    }
                },
                {
                    field: 'cdate',
                    title: '批复时间',
                    sortable: true
                },
                {
                    field: 'cname',
                    title: '批复人',
                    sortable: true
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.aid + '\')"><i class="fa fa-edit"></i>批复</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.aid + '\')"><i class="fa fa-edit"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });




</script>
</body>
</html>